using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace WTCOTH
{
    public partial class Game1 : Microsoft.Xna.Framework.Game
    {
        private void DrawWorld()
        {
            int tileSize = 64;
            // TODO: Add your drawing code here
            int k = 0, l = 0;
            for (float i = get_boundary("left"); i < mapWidth && i < get_boundary("right"); i++)
            {
                for (float j = get_boundary("top"); j < mapHeight && j < get_boundary("bottom"); j++)
                {

                    int type = Map.get_tile_type((int)j, (int)i);
                    if (type == 237)
                        spriteBatch.Draw(dirt, new Rectangle((l * tileSize), (k * tileSize), tileSize, tileSize), Color.White);
                    else if (type == 255)
                    {
                        if (f2 == 1)
                            spriteBatch.Draw(water, new Rectangle((l * tileSize), (k * tileSize), tileSize, tileSize), new Color(255, 255, 255, 255));
                        else
                            spriteBatch.Draw(water2, new Rectangle((l * tileSize), (k * tileSize), tileSize, tileSize), Color.White);

                    }
                    else
                    {
                        spriteBatch.Draw(sand, new Rectangle((l * tileSize), (k * tileSize), tileSize, tileSize), new Color(255, 255, 255, 255));
                    }
                    k++;
                }
                l++;
                k = 0;
            }
        }
    }
}
